/*package com.transcoachapp.Servlets;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import com.transcoachapp.BusFragment;
import com.transcoachapp.MainActivity;
import com.transcoachapp.data.BusStationDetail;

import android.os.AsyncTask;
import android.util.Log;
import android.view.Window;
import android.widget.Toast;

public class BusDriver{
	public BusDriver(String task){
		if(task.equalsIgnoreCase("busStationDetail"))
			new HttpTask().execute();
			
	}
	final class HttpTask extends AsyncTask<Void, Boolean, String> {
		public static final String url = "http://titan.cmpe.boun.edu.tr:8080/TransportationMid/";
		@Override
		protected String doInBackground(Void... param) {
			publishProgress(true);
	
			// Creating HTTP client
			HttpClient httpClient = new DefaultHttpClient();
	
			// Creating HTTP Post
			String operation = "getStationsOfBus?bus_text="+URLEncoder.encode("559C");
			HttpPost httpPost = new HttpPost(url+operation);
	
			// Building post parameters, key and value pair
	
	
			// Url Encoding the POST parameters
			try {
				//httpPost.setEntity(operation);
	
				// Making HTTP Request
				HttpResponse response = httpClient.execute(httpPost);
				return EntityUtils.toString(response.getEntity());
	
			} catch (ClientProtocolException e) {
				// writing exception to log
				e.printStackTrace();
	
			} catch (IOException e) {
				// writing exception to log
				e.printStackTrace();
			}
	
			return null;
		}
	
		@Override
		protected void onProgressUpdate(Boolean... progress) {
			//EventListActivity.this.setProgressBarIndeterminateVisibility(progress[0])
		//	BusFragment.class.this.setProgressBarIndeterminateVisibility(progress[0]);
		//	BusFragment.setProgress(progress[0]);
		}
	
		@Override
		protected void onPostExecute(String result) {
			publishProgress(false);
	
			if(result == null)
			{
			//	Toast.makeText((Context) BusFragment.class, (CharSequence)"Server connection error!", Toast.LENGTH_SHORT).show();
				Log.i("------------------------------------------","Server connection error!");
				return;
			}
	
			try
			{
				/////////////////////////////////////////////////////////////////////
				JSONArray jarray = new JSONArray(result);
				BusFragment.list = new ArrayList<BusStationDetail>();
				for(int i=0;i<jarray.length();i++){
					JSONObject bsd = jarray.getJSONObject(i);
					
					BusStationDetail bsdItem = new BusStationDetail(bsd.getInt("stationDetailId"), bsd.getString("stationCode"),bsd.getString("routeCode"),bsd.getString("routeDirection"),bsd.getInt("stationOrder"));
					Log.i("7777777777777777777777777777", bsdItem.getStationCode());
					BusFragment.list.add(bsdItem);
			//		BusFragment.list = new BusStationDetail[jarray.length()];
			//		BusFragment.list[i] = new BusStationDetail(bsd.getInt("stationDetailId"), bsd.getString("stationCode"),bsd.getString("routeCode"),bsd.getString("routeDirection"),bsd.getInt("stationOrder"));
					BusFragment.listLengt = jarray.length();

				/////////////////////////////////////////////////////////////////	 
				}
	
			} catch (JSONException e) {
				// writing exception to log
				e.printStackTrace();
			}
		}
		
	}
}
*/